#define M_XERROR

#include "XBaseError.h"
#include "XUtility.h"

const char* xerror(int err) {
	if ( err < XBaseClient::PERR_SUCCESS ) {
		return protocolErrorMessage[XBaseClient::PERR_UNKNOWN];
	} else if ( err <= XBaseClient::PERR_NUMBER ) {
		return protocolErrorMessage[err];
	} else if ( err <= XERROR_MAX ) {
		return protocolErrorMessageExt[err-XBaseClient::PERR_NUMBER];
	} else {
		return protocolErrorMessage[XBaseClient::PERR_UNKNOWN];
	}
}


